//
//  ZPPermanentThread.h
//  ZPPermanentThreadDemo
//
//  Created by mac on 2020/3/17.
//  Copyright © 2020 com.codezp. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^ZPPermanentThreadTask)(void);

@interface ZPPermanentThread : NSObject

/// 启动 (默认创建类时候就开始 也可以手动)
- (void)run;

/// 停止线程
- (void)stop;

/// 执行任务(block)
/// @param task 要执行代码
- (void)executeTask:(ZPPermanentThreadTask)task;

/// 执行任务(方法)
/// @param target 对象
/// @param action 方法
- (void)executeTaskWithTarget:(id)target action:(SEL)action;
@end
